import { Children, lazy } from "react";
import {
  AppOutline,
  AppstoreOutline,
  MessageOutline,
  UserContactOutline
} from 'antd-mobile-icons'

let Index = lazy(() => import('../pages/index'))
let Classify = lazy(() => import('../pages/classify'))
let Message = lazy(() => import('../pages/message'))
let User = lazy(() => import('../pages/user'))
let Home = lazy(() => import('../pages/home'))
let Login = lazy(() => import('../pages/login'))
let City = lazy(() => import('../pages/city'))
let Error = lazy(() => import('../pages/404'))


export let homeRouters = [
  {
    path: '/',
    element: <Index></Index>,
    title: '首页',
    icon: <AppOutline />,
  },
  {
    path: '/classify',
    element: <Classify></Classify>,
    title: '分类',
    icon: <AppstoreOutline />,
  },
  {
    path: '/message',
    element: <Message></Message>,
    title: '消息',
    icon: <MessageOutline />,
  },
  {
    path: '/user',
    element: <User></User>,
    title: '我的',
    icon: <UserContactOutline />,
  },
]

export let routers = [
  {
    path:'/',
    element:<Home></Home>,
    children:homeRouters
  },
  {
    path:'/login',
    element:<Login></Login>
  },
  {
    path:'/city',
    element:<City></City>
  },
  {
    path:'*',
    element:<Error></Error>
  },
]